fix: wire account override to /files page#1650
fix: wire account override to /files page#1650recoup-coding-agent wants to merge 1 commit intotestfrom
Conversation
Uses useAccountOverride() in sandbox hooks to pass the resolved accountIdOverride as account_id query param to the API. This ensures the /files page shows the overridden account's files when using the email query param override. Co-Authored-By: Paperclip <noreply@paperclip.ing>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Warning Rate limit exceeded
Your organization is not enrolled in usage-based pricing. Contact your admin to enable usage-based pricing to continue reviews beyond the rate limit, or try again in 8 minutes and 16 seconds. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (4)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 00173bdb7e
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
|
|
||
| const query = useQuery({ | ||
| queryKey: ["sandboxes"], | ||
| queryKey: ["sandboxes", accountIdOverride], |
There was a problem hiding this comment.
Delay sandbox query until account override is resolved
This query now keys on accountIdOverride, but it is still enabled whenever authenticated is true, so /files?email=... will fire an initial request with accountIdOverride === null while AccountOverrideProvider is still resolving the override. In that window, the page can render the signed-in user’s file tree before re-fetching the override account, which shows incorrect data and can expose the wrong account context briefly; gate the query on override-resolution state (or provider loading state) to avoid the initial null-account fetch.
Useful? React with 👍 / 👎.
| } | ||
|
|
||
| return getFileContents(accessToken, path); | ||
| return getFileContents(accessToken, path, accountIdOverride); |
There was a problem hiding this comment.
Reset file preview state when override account changes
After wiring accountIdOverride into getFileContents, this hook still retains prior selectedPath and mutation data across account switches, so changing override (or clearing it) can leave SandboxFilePreview showing content fetched for the previous account until another file is clicked. Since this path is now account-scoped, clear/reset mutation state on override change (or key mutation state by account) to prevent stale cross-account previews.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
No issues found across 4 files
Confidence score: 5/5
- Automated review surfaced no issues in the provided summaries.
- No files require special attention.
Requires human review: Modifies API request parameters and includes a cross-repository dependency (recoupable/api#410), which requires verification that the backend is ready.
Summary
useAccountOverride()intouseSandboxesanduseSandboxFileContenthooksaccountIdOverrideasaccount_idquery param to bothGET /api/sandboxesandGET /api/sandboxes/fileaccountIdOverridein react-query cache key for proper re-fetching when override changesContext
Part of REC-53: the
/filespage showed the logged-in user's files even when theemailoverride was active. TheAccountOverrideProvideralready resolved the email to accountId, but the sandbox hooks were not consuming the override. Now they do.Depends on: recoupable/api#410
Test plan
/files?email=someone@example.com— should show override account's files/fileswithout override — should show own files🤖 Generated with Claude Code
Summary by cubic
Fixes the /files page to respect the email-based account override by passing the resolved account_id to sandbox API calls. Addresses REC-53 so files and file contents reflect the overridden account, not the logged-in user.
Bug Fixes
useAccountOverride()intouseSandboxesanduseSandboxFileContent.account_idquery param toGET /api/sandboxesandGET /api/sandboxes/file.accountIdOverridein react-query keys to trigger refetch on change.Dependencies
Written for commit 00173bd. Summary will update on new commits.